package org.openweathermap.service;

import vn.hoasua.network.NetworkAdapter;
import android.content.Context;
import android.os.Handler;

public class WeatherService extends NetworkAdapter {

	public WeatherService(Context context, Handler handler,
			OnNetworkListener listener) {
		super(context, handler, listener);
	}

	public void get7DaysInfo(final int idMethod, final boolean forceLoad,
			final String country, final String cityName,
			final String... strings) {
		new Thread(new Runnable() {

			@Override
			public void run() {
				WeatherRequest request = new MakeUrl(context).getCityByName(
						country, cityName);
				sendHttpGet(idMethod, request.url, request.params, forceLoad,
						strings);
			}
		}).start();
	}

	public void getCityInfo(final int idMethod, final boolean forceLoad,
			final String country, final String cityName,
			final String... strings) {
		new Thread(new Runnable() {

			@Override
			public void run() {
				WeatherRequest request = new MakeUrl(context).getCityByName(
						country, cityName);
				sendHttpGet(idMethod, request.url, request.params, forceLoad,
						strings);
			}
		}).start();

	}
}
